package com.linkrenhe.frame.http;

public abstract class HttpResponse {
	
	public static final int STATE_SUCCESS = 0;
	public static final int STATE_FAILED = 1;
	public static final int STATE_NETWORK_ENABLE= 101;
	public static final int STATE_HTTP_FALSE = 2;
	public static final int STATE_READ_FALSE = 3;
	public static final int STATE_MEMORY_NOT_ENOUGH = 4;
	public static final int STATE_CREATE_REQUEST_ERROR = 5;
	
	private int mStateCode;
	
	

	private HttpRequest mHttpTask;
	
	private HttpRequest mHttpContinueTask;
	
	public HttpResponse(int state,HttpRequest httpRequest){
		this.mStateCode = state;
		this.mHttpTask = httpRequest;
	}
	
	public HttpResponse(int state,HttpRequest httpRequest,HttpRequest httpContinueRequest){
		this.mStateCode = state;
		this.mHttpTask = httpRequest;
		this.mHttpContinueTask = httpContinueRequest;
	}
	
	public HttpRequest getHttpContinueRequest(){
		return this.mHttpContinueTask;
	}
	
	public abstract HttpResponse createSameResponse(HttpRequest httpRequest);
	
	@Override
	public String toString() {
		return "mStateCode:"+mStateCode+"  url:"+mHttpTask.getUrl();
	}
	
	
	public int getStateCode() {
		return mStateCode;
	}

	public HttpRequest getHttpRequest() {
		return mHttpTask;
	}
}
